<template>
  <div style="height:100%;overflow:auto" ref="filesTable"> 
    <div ref="tableInner" class="tableInner">   
      <slot></slot>   
    </div> 
  </div>
</template>

<script>
    export default {
        name: "loadMore",
        mounted:function(){
          // 滚动加载更多
          const _this = this;
          const _filesTable = this.$refs.filesTable;
          const _offsetHeight = _filesTable.offsetHeight;
          _filesTable.addEventListener("scroll", () => {
            const _scrollTop = _filesTable.scrollTop;
            const _bodyHeight = _this.$refs.tableInner.clientHeight;
            if (_scrollTop + _offsetHeight >= _bodyHeight) {
              _this.$emit("dataScroll")
            }
          });
        }
    }



</script>

<style scoped>

</style>
